<?php
/* @var $this ProductAdminController */
/* @var $model Product */
/* @var $form CActiveForm */
?>
<div class="row-fluid sortable">
	<div class="box span12">
		<div class="box-header well" data-original-title>
			<h2>
				<i class="icon-edit">
				</i>
				Tìm kiếm
			</h2>
			<div class="box-icon">
				<?php
                    FormHelper::getBoxIcon();	
                ?>
			</div>
		</div>
		<div class="box-content">
			<?php $form=$this->beginWidget('CActiveForm', array(
            	'action'=>Yii::app()->createUrl($this->route),
            	'method'=>'get',
                'htmlOptions'=>array(
                    'class'=>'form-horizontal',
                ),
            )); ?>
				<fieldset>
					<div class="control-group">
	                    <?php echo $form->label($model,'product_id',FormHelper::setClass('labelEx')); ?>
						<div class="controls">
		                    <?php echo $form->textField($model,'product_id',FormHelper::setClass('textField')); ?>
						</div>
					</div>
                    <div class="control-group">
	                    <?php echo $form->label($model,'product_name',FormHelper::setClass('labelEx')); ?>
						<div class="controls">
		                    <?php echo $form->textField($model,'product_name',FormHelper::setClass('textField')); ?>
						</div>
					</div>
                    <div class="control-group">
	                    <?php echo $form->label($model,'product_price',FormHelper::setClass('labelEx')); ?>
						<div class="controls">
		                    <?php echo $form->textField($model,'product_price',FormHelper::setClass('textField')); ?>
						</div>
					</div>
                    <div class="control-group">
                        <?php echo $form->labelEx($model,'category_id',FormHelper::setClass('labelEx')); ?>
						<div class="controls">
                            <?php 
                            echo $form->dropDownList(
                                $model,
                                'category_id',
                                CHtml::listData(Category::model()->findAll('category_parent!=""'),'category_id','category_name'),
                                array(
                                    'ajax'=>array(
                                        'type'=>'POST',
                                        'url'=>Yii::app()->createUrl('ProductAdmin/LoadBrand'),
                                        'update'=>'#Product_brand_id',
                                        'data'=>array(
                                            'category_id'=>'js:this.value',
                                        ),
                                    ),
                                    'empty'=>'-- Chọn danh mục --',
                                )
                                ); ?>
		                    <?php echo $form->error($model,'category_id'); ?>
						</div>
					</div>
                    <div class="control-group">
                        <?php echo $form->labelEx($model,'brand_id',FormHelper::setClass('labelEx')); ?>
						<div class="controls">
                            <?php echo $form->dropDownList($model,'brand_id',array(),array('prompt'=>'-- Chọn thương hiệu --')); ?>
		                    <?php echo $form->error($model,'brand_id'); ?>
						</div>
					</div>
                    <div class="control-group">
	                    <?php echo $form->label($model,'product_quantity',FormHelper::setClass('labelEx')); ?>
						<div class="controls">
		                    <?php echo $form->textField($model,'product_quantity',FormHelper::setClass('textField')); ?>
						</div>
					</div> 
                    <div class="control-group">
	                    <?php echo $form->label($model,'product_view',FormHelper::setClass('labelEx')); ?>
						<div class="controls">
		                    <?php echo $form->textField($model,'product_view',FormHelper::setClass('textField')); ?>
						</div>
					</div>                    
                    <div class="control-group">
	                    <?php echo $form->label($model,'url',FormHelper::setClass('labelEx')); ?>
						<div class="controls">
		                    <?php echo $form->textField($model,'url',FormHelper::setClass('textField')); ?>
						</div>
					</div>
					<div class="form-actions">
	                    <?php echo CHtml::submitButton('Tìm kiếm',FormHelper::setClass('submitButton')); ?>
					</div>
				</fieldset>
			<?php $this->endWidget(); ?>
		</div>
	</div>
	<!--/span-->
</div>